package com.cn.jx.common.entity;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@MappedSuperclass
public abstract class BaseEntity implements Serializable{

	private static final long serialVersionUID = 426033381026407679L;
	
	/** <p>定义主键 实现uuid方式的自动生成机制 <p>字段长度64位<p>设置为{@link String String}类型*/
	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid")
	@Column(length=64,name="ID")
	private String id;
	
	/** <p>是否删除 1 删除 0 否 <p>设置为{@link Integer Integer}类型*/
	@Column(name="IS_DEL")
	private Integer delFlg;
	
	/** <p>是否可用 1 可用，0 不可用 <p>根据delFlg状态决定<p>设置为{@link Integer Integer}类型<p>例如：delFlg=1表示删除 validFlg=0表示不可用*/
	@Column(name="IS_VALID")
	private Integer validFlg;
	
	/** <p>操作时间 <p>数据创建，更新，删除等任何修改操作都会更新这个时间<p>设置为{@link Date 时间}类型*/
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="OPERAT_TIME")
	@CreatedDate
	private Date operatTime;
	
	/** <p>创建时间  <p>数据创建的时候的时间<p>设置为{@link Date 时间}类型*/
	@Temporal(TemporalType.TIMESTAMP)//设置为时间类型
	@Column(name="CREATE_TIME")
	@CreatedDate
	private Date createTime;
	
	@Column(length=64,name="CREATE_USER")
	private String createUser;
	
	@Column(length=64,name="OPERAT_USER")
	private String operatUser;
	
	/** <p>{@link String String}<p>getId()*/
	public String getId() {
		return id;
	}
	
	/** <p>{@link Integer Integer}<p>getDelFlg()*/
	public Integer getDelFlg() {
		return delFlg;
	}
	
	/** <p>{@link Integer Integer}<p>getValidFlg()*/
	public Integer getValidFlg() {
		return validFlg;
	}
	
	/** <p>{@link Date Date}<p>getOperatTime()*/
	public Date getOperatTime() {
		return operatTime;
	}
	
	/** <p>{@link Date Date}<p>getCreateTime()*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/** <p>setId({@link String id})*/
	public void setId(String id) {
		this.id = id;
	}
	
	/** <p>setDelFlg({@link Integer delFlg})*/
	public void setDelFlg(Integer delFlg) {
		this.delFlg = delFlg;
	}

	/** <p>setValidFlg({@link Integer validFlg})*/
	public void setValidFlg(Integer validFlg) {
		this.validFlg = validFlg;
	}

	/** <p>setOperatTime({@link Date operatTime})*/
	public void setOperatTime(Date operatTime) {
		this.operatTime = operatTime;
	}

	/** <p>setCreateTime({@link Date createTime})*/
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/** <p>{@link String String getCreateUser()*/
	public String getCreateUser() {
		return createUser;
	}

	/** <p>setCreateUser({@link String String createUser})*/
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	/** <p>{@link String String getOperatUser()*/
	public String getOperatUser() {
		return operatUser;
	}

	/** <p>setOperatUser({@link String String operatUser})*/
	public void setOperatUser(String operatUser) {
		this.operatUser = operatUser;
	}
	
}
